import 'package:flutter_test/flutter_test.dart';
import 'package:fameex_update/fameex_update.dart';
import 'package:fameex_update/fameex_update_platform_interface.dart';
import 'package:fameex_update/fameex_update_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFameexUpdatePlatform 
    with MockPlatformInterfaceMixin
    implements FameexUpdatePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<bool?> getCheckGoogleUpdate() {
    // TODO: implement getCheckGoogleUpdate
    throw UnimplementedError();
  }

  @override
  Future<void> getStartUpdate() {
    // TODO: implement startUpdate
    throw UnimplementedError();
  }
}

void main() {
  final FameexUpdatePlatform initialPlatform = FameexUpdatePlatform.instance;

  test('$MethodChannelFameexUpdate is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFameexUpdate>());
  });

  test('getPlatformVersion', () async {
    FameexUpdate fameexUpdatePlugin = FameexUpdate();
    MockFameexUpdatePlatform fakePlatform = MockFameexUpdatePlatform();
    FameexUpdatePlatform.instance = fakePlatform;
  
    expect(await fameexUpdatePlugin.getPlatformVersion(), '42');
  });
}
